package net.lab1024.sa.admin.module.business.roland.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.lab1024.sa.admin.module.business.roland.domain.form.*;
import net.lab1024.sa.admin.module.business.roland.domain.vo.RolandSeaVO;
import net.lab1024.sa.admin.module.business.roland.service.RolandSeaService;
import net.lab1024.sa.common.common.domain.PageResult;
import net.lab1024.sa.common.common.domain.ResponseDTO;
import net.lab1024.sa.common.common.domain.ValidateList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * 座位信息表 Controller
 *
 * @Author dragon
 * @Date 2023-12-11 13:29:10
 * @Copyright dragon
 */

@RestController
@Api(tags = "")
public class RolandSeaController {

    @Autowired
    private RolandSeaService rolandSeaService;

    @ApiOperation("分页查询 @author dragon")
    @PostMapping("/rolandSea/queryPage")
    public ResponseDTO<PageResult<RolandSeaVO>> queryPage(@RequestBody @Valid RolandSeaQueryForm queryForm) {
        return ResponseDTO.ok(rolandSeaService.queryPage(queryForm));
    }

    @ApiOperation("添加 @author dragon")
    @PostMapping("/rolandSea/add")
    public ResponseDTO<String> add(@RequestBody @Valid RolandSeaAddForm addForm) {
        return rolandSeaService.add(addForm);
    }

    @ApiOperation("更新 @author dragon")
    @PostMapping("/rolandSea/update")
    public ResponseDTO<String> update(@RequestBody @Valid RolandSeaUpdateForm updateForm) {
        return rolandSeaService.update(updateForm);
    }

    @ApiOperation("批量删除 @author dragon")
    @PostMapping("/rolandSea/batchDelete")
    public ResponseDTO<String> batchDelete(@RequestBody ValidateList<Integer> idList) {
        return rolandSeaService.batchDelete(idList);
    }

    @ApiOperation("单个删除 @author dragon")
    @GetMapping("/rolandSea/delete/{id}")
    public ResponseDTO<String> batchDelete(@PathVariable Integer id) {
        return rolandSeaService.delete(id);
    }

    @ApiOperation("启用禁用座位 @author dragon")
    @PostMapping("/rolandSea/updateAreaStatus")
    public ResponseDTO<String> updateAreaStatus(@RequestBody @Valid RolandSeaUpdateAreaStatusForm updateForm) {
        return rolandSeaService.updateAreaStatus(updateForm);
    }

    @ApiOperation("启用禁用座位 @author dragon")
    @PostMapping("/rolandSea/updateStatus")
    public ResponseDTO<String> updateStatus(@RequestBody @Valid RolandSeaUpdateStatusForm updateForm) {
        return rolandSeaService.updateStatus(updateForm);
    }



}
